//
//  LSZAddMVParentViewController.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/9/5.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZAddMVParentViewController.h"

@interface LSZAddMVParentViewController ()<LCDisplayViewControllerDelegate>

@end

@implementation LSZAddMVParentViewController

- (void)loadView {
    [super loadView];
    self.underLineWidth = 18;
    self.underLineBottom = 5;
}

-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}
- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"MV精选";
    self.delegate = self;
    [self setupAllViewController];
    [self setupAllVCData];
    self.view.backgroundColor = [UIColor whiteColor];
    [LCUtils lcAddSideLeftView:self.view];
}
- (void)setupAllViewController {
    // 推荐方式（设置下标）
    [self setUpUnderLineEffect:^(BOOL *isUnderLineDelayScroll, CGFloat *underLineH, UIColor *__autoreleasing *underLineColor, BOOL *isUnderLineEqualTitleWidth) {
        // 标题填充模式
        *underLineColor = redUIColor;
        *underLineH = 2;
    }];
    // 标题渐变
    // *推荐方式(设置标题渐变)
    [self setUpTitleGradient:^(LCTitleColorGradientStyle *titleColorGradientStyle, UIColor *__autoreleasing *norColor, UIColor *__autoreleasing *selColor) {
        *norColor = RGBColor(140, 140, 140);
        // 设置标题选中颜色
        *selColor = RGBColor(238, 82, 74);
    }];
    // 设置标题字体
    // 推荐方式
    [self setUpTitleEffect:^(UIColor *__autoreleasing *titleScrollViewColor, UIColor *__autoreleasing *norColor, UIColor *__autoreleasing *selColor, UIFont *__autoreleasing *titleFont, CGFloat *titleHeight, CGFloat *titleWidth) {
        // 设置标题字体
        if (ScreenWidth == 414) {
            *titleFont = FONT_(15.5);
        }else
            if (ScreenWidth == 375) {
                *titleFont = FONT_15;
            }else{
                *titleFont = FONT_(14.5);
            }
    }];
}
- (void)setupAllVCData {
    // 移除之前所有子控制器
    [self.childViewControllers makeObjectsPerformSelector:@selector(removeFromParentViewController)];
    NSArray *titleDatas = [[NSArray alloc]init];
    titleDatas = @[@"歌曲",@"专辑",@"歌手"];
    for (NSInteger i = 0; i < titleDatas.count; i++) {
        LSZMVDetailsViewController * vc = [[LSZMVDetailsViewController alloc]init];
        vc.title = titleDatas[i];
        vc.type = [[NSString alloc]initWithFormat:@"%ld",(long)i+1];
        [self addChildViewController:vc];
    }
    // 注意：必须先确定子控制器
    [self refreshDisplay];
}
-(void)tabBarContentViewDidSelectItemAtIndex:(NSInteger)index{
    NSLog(@"tabBarContentViewDidSelectItemAtIndex = %zd", index);
}

@end
